#- make list unique; remove duplicate items from list
#
#  MACRO_LIST_UNIQ(variable [item...])
#
# Store the list of items in variable, with duplicate items removed.
# Use this macro to create a list of unique items.

MACRO( MACRO_LIST_UNIQ var )
  SET( "${var}" "" )
  FOREACH( item ${ARGN} )
    LIST( REMOVE_ITEM "${var}" "${item}" )
    LIST( APPEND "${var}" "${item}" )
  ENDFOREACH( item )
ENDMACRO( MACRO_LIST_UNIQ )
